

void printdata(void)
{    
      //Serial.print("!");

	#ifdef PRINT_POLAR
#ifdef printVect
		//average heading
		Serial.print(printDist); ///vect_data.distDiv);
		Serial.print(" ");
		Serial.println(printHeading);
		//for(int i=0; i<32; i++){
		//	Serial.print(accelArray[i]);
		//	Serial.print(" ");
		//}
		Serial.println();
		//Serial.print(" ");
		//Serial.println(pitch);
#endif

#ifdef printRaw
		Serial.print(raw_data[0]);
		Serial.print(" ");
		Serial.print(raw_data[1]);
		Serial.print(" ");
		Serial.print(raw_data[2]);
		Serial.print(" ");
		Serial.print(raw_data[3]);
		Serial.print(" ");
		Serial.print(raw_data[4]);
		Serial.print(" ");
		Serial.print(raw_data[5]);
		Serial.print(" ");
		Serial.println(raw_data[6]);
#endif
	#endif
      
	#ifdef PRINT_EULER
      Serial.print("ANG:");
      Serial.print(ToDeg(roll));
      Serial.print(" ||| ");
      Serial.print(ToDeg(pitch));
      Serial.print(" ||| ");
      Serial.print(ToDeg(yaw));
	#endif   
      
    
    #ifdef PRINT_CRTD_ACCEL
      Serial.print("    Accel: ");
      Serial.print(sen_data.accel_x);
      Serial.print (" ||| ");
      Serial.print(sen_data.accel_y);
      Serial.print (" ||| ");
      Serial.print(sen_data.accel_z);
    #endif  
      
	#ifdef PRINT_CRTD_GYRO
	  Serial.print(sen_data.gyro_x);
      Serial.print(" ||| ");
      Serial.print(sen_data.gyro_y);
      Serial.print(" ||| ");
      Serial.print(sen_data.gyro_z);  
	#endif

	#ifdef PRINT_SENSOR_DATA
	  Serial.print("SEN:,");
      Serial.print(sen_data.accel_x);
      Serial.print (",");
      Serial.print(sen_data.accel_y);
      Serial.print (",");
      Serial.print(sen_data.accel_z);
      Serial.print(",");
      Serial.print(sen_data.gyro_x);
      Serial.print(",");
      Serial.print(sen_data.gyro_y);
      Serial.print(",");
      Serial.print(sen_data.gyro_z);  
      Serial.print(",");
      Serial.print((int)sen_data.magnetom_x);
      Serial.print (",");
      Serial.print((int)sen_data.magnetom_y);
      Serial.print (",");  
      Serial.print((int)sen_data.magnetom_z);    
      //Serial.print (",");
      //Serial.print(sen_data.magnetom_heading );     
	#endif

      #ifdef PRINT_SENSOR_DATA_RAW
      Serial.print(",RAW:,");
      Serial.print(sen_data.accel_x_raw);
      Serial.print (",");
      Serial.print(sen_data.accel_y_raw);
      Serial.print (",");
      Serial.print(sen_data.accel_z_raw);
      Serial.print(",");
      Serial.print(sen_data.gyro_x_raw);
      Serial.print(",");
      Serial.print(sen_data.gyro_y_raw);
      Serial.print(",");
      Serial.print(sen_data.gyro_z_raw);  
      Serial.print(",");
      Serial.print((int)sen_data.magnetom_x_raw);
      Serial.print (",");
      Serial.print((int)sen_data.magnetom_y_raw);
      Serial.print (",");
      Serial.print((int)sen_data.magnetom_z_raw);    
      #endif
      
      
      #ifdef PRINT_DCM
      Serial.print (",DCM:");
      Serial.print(convert_to_dec(DCM_Matrix[0][0]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[0][1]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[0][2]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[1][0]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[1][1]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[1][2]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[2][0]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[2][1]));
      Serial.print (",");
      Serial.print(convert_to_dec(DCM_Matrix[2][2]));
      #endif
      
      
      Serial.println();    
}

long convert_to_dec(float x)
{
  return x*10000000;
}

